home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / TEXPLIST.ZIP / demo / Delphi 4 / unit1.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1999-02-01  |  3.3 KB  |  140 lines

  1. unit Unit1;
  2.                      
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   ComCtrls, StdCtrls, Menus, ExtCtrls, People, ShellAPI,
  8.  
  9.   // TExportListView Units
  10.   ExportLView, ELV_Main;
  11.  
  12. type
  13.   TForm1 = class(TForm)
  14.     ExportListView1: TExportListView;
  15.     MainMenu1: TMainMenu;
  16.     File1: TMenuItem;
  17.     Print1: TMenuItem;
  18.     PrintSetup1: TMenuItem;
  19.     N1: TMenuItem;
  20.     Exit1: TMenuItem;
  21.     PrinterSetupDialog1: TPrinterSetupDialog;
  22.     Panel1: TPanel;
  23.     PageControl1: TPageControl;
  24.     TabSheet4: TTabSheet;
  25.     TabSheet5: TTabSheet;
  26.     TabSheet2: TTabSheet;
  27.     ListView1: TListView;
  28.     Button1: TButton;
  29.     Button2: TButton;
  30.     Button3: TButton;
  31.     Bevel1: TBevel;
  32.     Shape2: TShape;
  33.     Label2: TLabel;
  34.     Shape3: TShape;
  35.     Label5: TLabel;
  36.     Shape4: TShape;
  37.     Label8: TLabel;
  38.     Label9: TLabel;
  39.     Label10: TLabel;
  40.     Label11: TLabel;
  41.     Label6: TLabel;
  42.     TabSheet1: TTabSheet;
  43.     Shape1: TShape;
  44.     Label1: TLabel;
  45.     Shape6: TShape;
  46.     Label3: TLabel;
  47.     Button4: TButton;
  48.     Button5: TButton;
  49.     Shape5: TShape;
  50.     Label7: TLabel;
  51.     procedure PrintSetup1Click(Sender: TObject);
  52.     procedure Print1Click(Sender: TObject);
  53.     procedure Button2Click(Sender: TObject);
  54.     procedure Button1Click(Sender: TObject);
  55.     procedure Label8Click(Sender: TObject);
  56.     procedure Label9Click(Sender: TObject);
  57.     procedure Button5Click(Sender: TObject);
  58.     procedure Button4Click(Sender: TObject);
  59.   private
  60.     { Private declarations }
  61.   public
  62.     { Public declarations }
  63.   end;
  64.  
  65. var
  66.   Form1: TForm1;
  67.  
  68. implementation
  69.  
  70. {$R *.DFM}
  71.  
  72. // *** Print Code ***
  73.  
  74. procedure TForm1.PrintSetup1Click(Sender: TObject);
  75. begin
  76.   // Print Setup
  77.   PrinterSetupDialog1.Execute;
  78. end;
  79.  
  80. procedure TForm1.Print1Click(Sender: TObject);
  81. begin
  82.   // Print
  83.   ExportListView1.Print;
  84. end;
  85.  
  86. // *** Demo 1 Code
  87.  
  88. procedure TForm1.Button2Click(Sender: TObject);
  89. begin
  90.   // Let User choose the Export Type
  91.   ExportListView1.Choose;
  92. end;
  93.  
  94. procedure TForm1.Button1Click(Sender: TObject);
  95. begin
  96.   // Ignore this, it's just my Random People Generator (tm)
  97.   GeneratePeople(ListView1);
  98. end;
  99.  
  100. // *** Demo 2 Code ***
  101.  
  102. procedure TForm1.Button5Click(Sender: TObject);
  103. begin
  104.   with ExportListView1 do
  105.   begin
  106.     ExportType := xMicrosoft_Word;
  107.     Options := Options + [NumberRows]; // We Want Row Numbering
  108.     ViewOnly := True;                  // Export to Screen
  109.     Execute;                           // Do Export
  110.   end;
  111. end;
  112.  
  113. procedure TForm1.Button4Click(Sender: TObject);
  114. begin
  115.   with ExportListView1 do
  116.   begin
  117.     ExportType := xMicrosoft_Word;
  118.     Options := Options + [NumberRows]; // We Want Row Numbering
  119.     ViewOnly := False;                 // Export to Screen
  120.     ExportFile := '';                  // Ensure it's blank, so we get a file dialog
  121.     Execute;                           // Do Export
  122.   end;
  123. end;
  124.  
  125. // *** Please Ignore
  126.  
  127. procedure TForm1.Label8Click(Sender: TObject);
  128. begin
  129.   // Visit our Web Page
  130.   ShellExecute(0, PChar('open'), PChar(cComponentsWebSite), PChar(''), PChar(''), SW_SHOWNORMAL);
  131. end;
  132.  
  133. procedure TForm1.Label9Click(Sender: TObject);
  134. begin
  135.   // Send us E-mail
  136.   ShellExecute(0, PChar('open'), PChar(cComponentsMailto), PChar(''), PChar(''), SW_SHOWNORMAL);
  137. end;
  138.  
  139. end.
  140.